/imbuf w bits mul 4 mul 7 add 8 idiv string def x0 y0 translate w h bits [sx 0 0 sy 0 0] {currentfile imbuf AsBin {readstring} {readhexstring} ifelse pop} false 4 colorimage } def /S_CMYKIMAGE { /bits exch def /h exch def /w exch def /dh exch def /dw exch def /y0 exch def /x0 exch def /AsBin exch def /sx w dw div def /sy h dh div def DFLT /imbuf w bits mul 3 mul 7 add 8 idiv string def x0 y0 translate w h bits [sx 0 0 sy 0 0] {currentfile imbuf AsBin {readstring} {readhexstring} ifelse pop} false 3 colorimage } def /S_RGBIMAGE { /bits exch def /h exch def /w exch def /dh exch def /dw exch def /y0 exch def /x0 exch def /AsBin exch def /sx w dw div def /sy h dh div def 3 add index exch 2 add index dup 4 1 roll sub mul add counttomark 1 add 1 roll cleartomark} counttomark dup 3 add -1 roll exch 2 sub mul dup floor cvi dup 3 1 roll sub exch dup {exch pop abs 1 exch sub} { abs exch abs 2 copy add 1 gt {1 sub dup mul exch 1 sub dup mul add 1 sub }{ dup mul exch dup mul add 1 exch sub } ifelse } /imbuf w bits mul 7 add 8 idiv string def x0 y0 translate w h bits [sx 0 0 sy 0 0] {currentfile imbuf AsBin {readstring} {readhexstring} ifelse pop} /sx w dw div def /sy h dh div def /bits exch def /h exch def /w exch def /dh exch def /dw exch def /y0 exch def /x0 exch def /AsBin exch def /S_IMAGEV3 { /imbuf w 7 add 8 idiv string def x0 y0 translate w h inv [sx 0 0 sy 0 0] {currentfile imbuf AsBin {readstring} {readhexstring} ifelse pop} imagemask } def /S_IMAGEMASKV3 { /inv exch def /h exch def /w exch def /dh exch def /dw exch def /y0 exch def /x0 exch def /AsBin exch def /sx w dw div def /sy h dh div def